# https
""" import http.client
import json

conn = http.client.HTTPSConnection("59.110.226.22", 8061)
payload = json.dumps({
  "Number": "2",
  "Name": "test2",
  "ParentGUID": "1463077255105220608",
  "Type": "section",
  "BeforeOrderBy": "0",
  "AfterOrderBy": "16376598174538872"
})
headers = {
  'Cookie': 'Access_RefreshKey=1462679662479020032; Access_Token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJHVUlEIjoiYzg2ODk5YTAtMmY5YS00NDE0LWI5NzgtZjhmMGIwYmUyMmQzIiwiZXhwIjoxNjM3NTkzNzgxLCJpYXQiOjE2Mzc1NjQ5ODF9.rsFymJAl65NO4k9RmSNhy-8vsPF-FwAjr2uiLHRGfSM; Official_Token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJHVUlEIjoiMiIsIlVzZXJuYW1lIjoiYWRtaW4iLCJSb2xlR1VJRHMiOlsxMjkxOTkwMzc0NjQ2MDI2MjQwLDEzNDkyNDk5MTM0Mzg4Njc0NTYsMTM0OTI4ODc0NjA4Nzg3ODY1NiwxMzQ5Mjg5MDY1Nzk0NTA2NzUyLDEzNDkyODkxMjQ4NDYxMTI3NjgsMTM0OTY0MDc3MzYzMjUyODM4NCwxMzQ5NjQwODQzNjI3MDczNTM2LDEzNDk2NDE4MzA1MTMyNTAzMDQsMTM0OTY0MTg4MTM4MTc2OTIxNiwxMzQ5NjQxOTM2MjA5NzExMTA0LDEzNDk2NDE5OTA3NjUwMjMyMzIsMTM0OTY0MjAzODY4NDk0NjQzMiwxMzUzMTYzNzA4MDU4MDQ2NDY0LDE0NTUwMTYyOTEzOTQ5MTYzNTNdLCJleHAiOjE2Mzg0MjU1NjMsImlzcyI6InRyYWZmaWMiLCJuYmYiOjE2Mzc4MTk3NjN9.huTUuZybqJbMmDU7lB6JxRjZbmAGDh_UnI2vHOy6coo',
  'Content-Type': 'application/json'
}
conn.request("POST", "/api/base/project/add", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8")) """


import requests
import json

url = "http://59.110.226.22:8061/api/base/project/add"

Number = "2"
Name = "test"
ParentGUID="1463077255105220608"
Type="section"
BeforeOrderBy="0"
AfterOrderBy="16376598174538872"

payload = json.dumps({
  "Number": Number,
  "Name": Name,
  "ParentGUID": ParentGUID,
  "Type": Type,
  "BeforeOrderBy": BeforeOrderBy,
  "AfterOrderBy": AfterOrderBy
})

headers = {
  'Cookie': 'Official_Token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJHVUlEIjoiMiIsIlVzZXJuYW1lIjoiYWRtaW4iLCJSb2xlR1VJRHMiOlsxMjkxOTkwMzc0NjQ2MDI2MjQwLDEzNDkyNDk5MTM0Mzg4Njc0NTYsMTM0OTI4ODc0NjA4Nzg3ODY1NiwxMzQ5Mjg5MDY1Nzk0NTA2NzUyLDEzNDkyODkxMjQ4NDYxMTI3NjgsMTM0OTY0MDc3MzYzMjUyODM4NCwxMzQ5NjQwODQzNjI3MDczNTM2LDEzNDk2NDE4MzA1MTMyNTAzMDQsMTM0OTY0MTg4MTM4MTc2OTIxNiwxMzQ5NjQxOTM2MjA5NzExMTA0LDEzNDk2NDE5OTA3NjUwMjMyMzIsMTM0OTY0MjAzODY4NDk0NjQzMiwxMzUzMTYzNzA4MDU4MDQ2NDY0LDE0NTUwMTYyOTEzOTQ5MTYzNTNdLCJleHAiOjE2NDAzMTU0NTMsImlzcyI6InRyYWZmaWMiLCJuYmYiOjE2Mzk3MDk2NTN9.emctZo8cRQggMXoSxdN-jkueNXMl_eH0p-X2PGRDk8g',
  'Content-Type': 'application/json; charset=UTF-8;multipart/form-data'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
